﻿'use strict';

resumeApp.controller('personalInfoCtrl', ['$scope', 'personalInfoService', function ($scope, personalInfoService) {
    $scope.data = personalInfoService;

    $scope.isBusy = false;

    if (personalInfoService.isReady() == false) {
        $scope.isBusy = true;

        personalInfoService.getPersonalInfos()
        .then(function () {
            // success
        },
        function () {
            // error
            alert("could not load personalInfos");
        })
        .then(function () {
            $scope.isBusy = false;
        });
        
    }

    //$scope.resumes contains a promise object
    //$scope.personalInfos = personalInfoService.getPersonalInfos();
    ////console.log($scope.resumes);
    ////to get to the resumes object you do this
    //$scope.personalInfos.then(function (personalInfos) {
    //    console.log(personalInfos);
    //}, function (status) {
    //    console.log(status);
    //});

}]);